package com.zhang.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.NoArgsConstructor;

@Api(tags = "库存实体类")
@Data
@NoArgsConstructor
@TableName("t_product")
public class ProductBean {


    @ApiModelProperty("库存id")
    @TableId(value = "pk_productId",type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty("商品编号")
    @TableField(value = "p_number")
    private String number;

    @ApiModelProperty("商品名")
    @TableField(value = "p_name")
    private String name;

    @ApiModelProperty("厂家")
    @TableField(value = "p_mill")
    private String mill;

    @ApiModelProperty("建议采购价")
    @TableField(value = "p_purchase")
    private Integer purchase;

    @ApiModelProperty("建议销售价")
    @TableField(value = "p_sale")
    private Integer sale;

    @ApiModelProperty("库存数量")
    @TableField(value = "p_count")
    private Integer count;

    @ApiModelProperty("商品图片")
    @TableField(value = "p_img")
    private String img;

    @ApiModelProperty("商品所属类别")
    @TableField("fk_typeId")
    private Integer typeId;

    @TableField(exist = false)
    private TypeBean typeBean;

    public ProductBean(String number, String name, String mill, int purchase, int sale, int count, String img, int typeId) {
        this.number = number;
        this.name = name;
        this.mill = mill;
        this.purchase = purchase;
        this.sale = sale;
        this.count = count;
        this.img = img;
        this.typeId = typeId;
    }

    @Override
    public String toString() {
        return "ProductBean{" +
                "id=" + id +
                ", number='" + number + '\'' +
                ", name='" + name + '\'' +
                ", mill='" + mill + '\'' +
                ", purchase=" + purchase +
                ", sale=" + sale +
                ", count=" + count +
                ", img='" + img + '\'' +
                ", typeId=" + typeId +
                '}' + "\n";
    }
}
